<html lang="en">
<head>
    <title>待审核游记管理</title>
    <#include "../common/header.ftl">
    <script type="text/javascript" src="/js/plugins/jquery-form/jquery.form.js"></script>
    <script>
        $(function () {
            //改变状态
            $('.changeBtn').click(function () {
                var id = $(this).data("id");
                var state =$(this).data("state");
                var title = $(this).data("title");
                //发送ajax保存数据
                $.post("/travel/changeList.do",{id:id,state:state,title:title},function (data) {
                    if(data.success){
                        window.location.reload();
                    }else {
                        window.messager.alert("温馨提示",e.msg);
                    }
                })




            })
            //end------------------------------------------
            //获取文章的内筒
            $(".contentBtn").click(function () {
                var id = $(this).data("id");
                //发送ajax,获得文章的内容.将文章的内容复制到模态框中
                $.get("/travel/getContentByTravelId.do",{id:id},function (data) {
                    $("#contentModal .modal-body").html(data.content);
                    $("#contentModal").modal("show");
                })

            })
            //end--------------------------------------
        })
    </script>
    <style>
        #contentModal img{
            width: 100%;/*模态框中出现的图片大小占模态框的多少*/
        }
        #contentModal .modal-body{
            max-height: 600px;
            overflow-y: auto; /*模态框的滑动,*/
        }
    </style>
</head>
<body>
<!--左侧菜单回显变量设置-->
<#assign currentMenu="travel">
<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-2">
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-10">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">待审核游记管理</h1>
                </div>
            </div>
            <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/travel/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label for="keyword">关键字:</label>
                    <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}" placeholder="请输入标题">
                </div>
                <button id="btn_query" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> 查询</button>
            </form>
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>标题</th>
                    <th>封面</th>
                    <th>地点</th>
                    <th>作者</th>
                    <th>状态</th>
                    <th>编辑</th>
                </tr>
                </thead>
                <#list result.list as entity >
                     <tr>
                         <td>${entity.title!}</td>
                         <td><img src="${entity.coverUrl!}" width="30px;"></td>
                         <td>${(entity.place.name)!}</td>
                         <td>${(entity.author.nickName)!}</td>
                         <td>${entity.stateDisplay!}</td>
                         <td>
                             <a href="javascript:;" class="btn changeBtn" data-title=${entity.title}, data-state="3" data-id=${entity.id}>发布</a>
                             <a href="javascript:;" class="btn changeBtn" data-state="0" data-id=${entity.id} >拒绝</a>
                             <a href="javascript:;" class="btn contentBtn" data-id=#{entity.id}>查看文章内容</a>
                         </td>
                     </tr>
                </#list>
            </table>
            <#include "../common/page.ftl">
        </div>
    </div>
</div>

<#--查看文章的内容-->
<div id="contentModal" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">文章内容</h4>
            </div>
            <div class="modal-body">

            </div>
            <div class="modal-footer">
                <a href="javascript:void(0);" class="btn" data-dismiss="modal" aria-hidden="true">确定</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>
